<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>智能控制管理</title>
    <meta name="decorator" content="default"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/jeesite/intergent/css/inergent.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/jeesite/intergent/js/intergent.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li><a href="${ctx}/intelligent/intelligentController/">智能控制列表</a></li>
    <li class="active"><a href="${ctx}/intelligent/intelligentController/form?id=${intelligentController.id}">智能控制<shiro:hasPermission name="intelligent:intelligentController:edit">${not empty intelligentController.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="intelligent:intelligentController:edit">查看</shiro:lacksPermission></a></li>
</ul><br/>

<form id="inputForm" modelAttribute="intelligentController" action="${ctx}/intelligent/intelligentController/save" method="post" class="form-horizontal">
    <div class="control">
		<label class="control-label">信号灯:</label>
		<div class="controls">
             <select name="lightId" id="lightId" class="form-control" style="width:195px;">
                  <c:forEach var="app" items="${allSignlights}">
                      <option value="${app.id }">${app.lightname }</option>
                  </c:forEach>
            </select>
		</div>
    </div>

    <div class="control">
        <label class="control-label">控制方式：</label>
        <div class="controls">
            <%--<input type="text" name="controller" id="controller" placeholder="hahah" />--%>
            <label class="radio-inline">
                <input type="radio" name="controlStyle" value="0" checked="checked"> 自动
            </label>
            <label class="radio-inline">
                <input type="radio" name="controlStyle"  value="1" > 手动
            </label>
                <label class="radio-inline">
                    <input type="radio" name="controlStyle"  value="2" > 定时
                </label>
        </div>
    </div>
    <div class="control center hidden">
        <div style="overflow: hidden;">
            <%--<label class="control-label">方案一:</label>--%>
            <label class="control-label" >绿灯:</label>
            <div class="switch" data-on="success" data-off="warning">
                <input type="checkbox" checked />
            </div>
            <%--<label style="width: 43px; margin-left: 10px;">红灯</label>--%>
        </div>
    </div>
    <div class="divone hidden">
        <div class="control">
            <label class="control-label">开始时间：</label>
            <div class="controls">
                <input name="startTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
                       value="<fmt:formatDate value="${intelligentController.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                       onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
            </div>
        </div>
        <div class="control">
            <label class="control-label">结束时间：</label>
            <div class="controls">
                <input name="endTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
                       value="<fmt:formatDate value="${intelligentController.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                       onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
            </div>
        </div>
    </div>
    <div class="control control-bottom">
        <shiro:hasPermission name="intelligent:intelligentController:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
        <button type="button" class="btn btn-default btn-sm" onclick="history.go(-1)">取消</button>
    </div>

</form>

</body>
</html>